home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / ifl_c / iflLut.z / iflLut
Encoding:
Text File  |  2002-10-03  |  14.8 KB  |  397 lines

  1.  
  2.  
  3.  
  4. iiiiffffllllLLLLuuuutttt((((3333))))         IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll          iiiiffffllllLLLLuuuutttt((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      iiiiffffllllLLLLuuuutttt - base class for defining look-up tables
  10.  
  11.  
  12. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  13.      This is a base class with no inheritance.
  14.  
  15.  
  16. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  17.      #include <il/ilCdefs.h>
  18.  
  19.  
  20. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  21.      iflLut is a base class used for accessing and manipulating look-up
  22.      tables. The class definition provides the necessary data structure for
  23.      defining and accessing the look-up table.
  24.  
  25.      A look-up table is defined by the number of channels, the range of input
  26.      values it expects (the domain), the data type, and the actual look-up
  27.      table data.  There is a table for each channel and the size and data type
  28.      of each table is the same.  The look-up table data is stored in
  29.      iflSequential format. In other words, the table for each channel is
  30.      stored contiguously.  The tables for each channel are packed together
  31.      into a single array.
  32.  
  33.    UUUUssssiiiinnnngggg iiiiffffllllLLLLuuuutttt
  34.      The iflLut object can either be used to allocate a look-up table whose
  35.      values are filled in by calls to the sssseeeettttVVVVaaaallll() function, or it can be used
  36.      to wrap an object definition around an existing array of lut values.
  37.      Constructors are provided for both of these usages.  When the iflLut
  38.      allocates the tables, it frees them when it is deleted.  If the tables
  39.      are passed to the constructor, then the caller is responsible for the
  40.      management of the table memory.  Once an iflLut is constructed, its table
  41.      can be completely replaced using the sssseeeettttDDDDaaaattttaaaa() function, or it can be
  42.      modified an entry at a time with sssseeeettttVVVVaaaallll().
  43.  
  44.      The values in the lut can be accesed by getting a pointer to the table
  45.      with ggggeeeettttDDDDaaaattttaaaa(), ggggeeeettttCCCChhhhaaaannnn() or ggggeeeettttOOOOrrrriiiiggggiiiinnnn().  The pointer returned must be
  46.      cast to match the internal type of the table as returned by
  47.      ggggeeeettttDDDDaaaattttaaaaTTTTyyyyppppeeee().  Alternatively, individual entries in the table can be
  48.      accesed using the ggggeeeettttVVVVaaaallll() function.  While less efficient, this function
  49.      is easier to use since ggggeeeettttVVVVaaaallll() automatically converts to double so that
  50.      the data type of the table can be ignored. It also automatically deals
  51.      with and scaling necessary to deal with a domain that is not a one to one
  52.      mapping onto the number of entries in the look up tables.
  53.  
  54.      The range of values contained in the tables can be interrogated by
  55.      ggggeeeettttRRRRaaaannnnggggeeee(((()))).  The range of values the lut expects as input can be accessed
  56.      with ggggeeeettttDDDDoooommmmaaaaiiiinnnn().
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiiffffllllLLLLuuuutttt((((3333))))         IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll          iiiiffffllllLLLLuuuutttt((((3333))))
  71.  
  72.  
  73.  
  74. CCCCLLLLAAAASSSSSSSS MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN SSSSUUUUMMMMMMMMAAAARRRRYYYY
  75.      CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr
  76.  
  77.           iflLut* iflLutCreate(int numChan, iflDataType dtype, double min,
  78.                                double max, int length)
  79.           iflLut* iflLutNoAlloc(void* table, int numChan, iflDataType dtype,
  80.                                 double min, double max, int length)
  81.           iflLut* iflLutCopy(const iflLut* other)
  82.  
  83.      DDDDeeeessssttttrrrruuuuccccttttoooorrrr
  84.  
  85.           void iflLutDelete(iflLut* obj)
  86.  
  87.      BBBBaaaassssiiiicccc aaaattttttttrrrriiiibbbbuuuutttteeeessss
  88.  
  89.           int iflLutGetNumChans(iflLut *obj)
  90.           iflDataType iflLutGetDataType(iflLut *obj)
  91.           int iflLutGetLength(iflLut *obj)
  92.  
  93.      EEEEnnnnttttrrrryyyy aaaacccccccceeeessssssss
  94.  
  95.           double iflLutGetVal(iflLut *obj, double domainIdx, int chan)
  96.           iflStatus iflLutSetVal(iflLut *obj, double val, double domainIdx,
  97.                                  int chan)
  98.  
  99.      DDDDiiiirrrreeeecccctttt ttttaaaabbbblllleeee aaaacccccccceeeessssssss
  100.  
  101.           void* iflLutGetOrigin(iflLut *obj, int chan)
  102.           void* iflLutGetChan(iflLut *obj, int chan)
  103.           void* iflLutGetData(iflLut *obj)
  104.           void iflLutSetData(iflLut *obj, void* dataPnt)
  105.  
  106.      DDDDoooommmmaaaaiiiinnnn aaaannnndddd rrrraaaannnnggggeeee ccccoooonnnnttttrrrroooollll
  107.  
  108.           void iflLutGetDomain(iflLut *obj, double* min, double* max)
  109.           double iflLutGetDomainMin(iflLut *obj)
  110.           double iflLutGetDomainMax(iflLut *obj)
  111.           double iflLutGetDomainStep(iflLut *obj)
  112.           void iflLutGetRange(iflLut *obj, double* min, double* max)
  113.           iflStatus iflLutSetDomain(iflLut *obj, double min, double max)
  114.  
  115.      CCCCoooommmmppppaaaarrrriiiissssoooonnnn
  116.  
  117.           int iflLutIsDiff(iflLut *obj, const iflLut* from)
  118.  
  119.  
  120.  
  121. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
  122.      iiiiffffllllLLLLuuuutttt(((())))
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. iiiiffffllllLLLLuuuutttt((((3333))))         IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll          iiiiffffllllLLLLuuuutttt((((3333))))
  137.  
  138.  
  139.  
  140.           iflLut* iflLutCopy(const iflLut* other)
  141.           iflLut* iflLutCreate(int numChan, iflDataType dtype, double min,
  142.                                double max, int length)
  143.           iflLut* iflLutNoAlloc(void* table, int numChan, iflDataType dtype,
  144.                                 double min, double max, int length)
  145.  
  146.  
  147.           Constructors for the iflLut class.  The number of tables or channels
  148.           in the lut is specified by _n_u_m_C_h_a_n and the LUT data type is
  149.           specified by _d_t_y_p_e.  The domain of values the table handles is from
  150.           _m_i_n to _m_a_x.  The length of each table is either _m_a_x-_m_i_n+1 if _l_e_n_g_t_h
  151.           is 0, otherwise it is given by _l_e_n_g_t_h.  A constructor is also
  152.           provided that creates an iflLut whose look-up table data is  pointed
  153.           to by _t_a_b_l_e. Another constructor is provided that copies the tables
  154.           and attributes from the iflLut specified by _o_t_h_e_r into this object
  155.  
  156.      iiiiffffllllLLLLuuuuttttDDDDeeeelllleeeetttteeee(((())))
  157.  
  158.           void iflLutDelete(iflLut *obj)
  159.  
  160.  
  161.           Deletes an object of class iflLut, thus freeing any associated
  162.           resources.
  163.  
  164.      ggggeeeettttCCCChhhhaaaannnn(((())))
  165.  
  166.           void* iflLutGetChan(iflLut *obj, int chan)
  167.  
  168.  
  169.           Returns a pointer to the beginning of the table for channel number
  170.           _c_h_a_n.
  171.  
  172.      ggggeeeettttDDDDaaaattttaaaa(((())))
  173.  
  174.           void* iflLutGetData(iflLut *obj)
  175.  
  176.  
  177.           Returns a pointer to the overall beginning of the tables for all
  178.           channels.  If returns the same value as ggggeeeettttCCCChhhhaaaannnn(0).
  179.  
  180.      ggggeeeettttDDDDaaaattttaaaaTTTTyyyyppppeeee(((())))
  181.  
  182.           iflDataType iflLutGetDataType(iflLut *obj)
  183.  
  184.  
  185.           Returns the data type of the entries in the look-up table.
  186.  
  187.      ggggeeeettttDDDDoooommmmaaaaiiiinnnn(((())))
  188.  
  189.           void iflLutGetDomain(iflLut *obj, double* min, double* max)
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. iiiiffffllllLLLLuuuutttt((((3333))))         IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll          iiiiffffllllLLLLuuuutttt((((3333))))
  203.  
  204.  
  205.  
  206.           Returns the domain, in _m_i_n and _m_a_x, that the look-up table handles
  207.           as input.
  208.  
  209.      ggggeeeettttDDDDoooommmmaaaaiiiinnnnMMMMaaaaxxxx(((())))
  210.  
  211.           double iflLutGetDomainMax(iflLut *obj)
  212.  
  213.  
  214.           Returns the maximum value that the look-up table handles as input.
  215.  
  216.      ggggeeeettttDDDDoooommmmaaaaiiiinnnnMMMMiiiinnnn(((())))
  217.  
  218.           double iflLutGetDomainMin(iflLut *obj)
  219.  
  220.  
  221.           Returns the minimum value that the look-up table handles as input.
  222.  
  223.      ggggeeeettttDDDDoooommmmaaaaiiiinnnnSSSStttteeeepppp(((())))
  224.  
  225.           double iflLutGetDomainStep(iflLut *obj)
  226.  
  227.  
  228.           Returns the incremental step in the domain space between adjacent
  229.           entries in the look-up table.
  230.  
  231.      ggggeeeettttLLLLeeeennnnggggtttthhhh(((())))
  232.  
  233.           int iflLutGetLength(iflLut *obj)
  234.  
  235.  
  236.           Returns the length of a table for an individual channel.
  237.  
  238.      ggggeeeettttNNNNuuuummmmCCCChhhhaaaannnnssss(((())))
  239.  
  240.           int iflLutGetNumChans(iflLut *obj)
  241.  
  242.  
  243.           Returns the number of channels in the look-up table.
  244.  
  245.      ggggeeeettttOOOOrrrriiiiggggiiiinnnn(((())))
  246.  
  247.           void* iflLutGetOrigin(iflLut *obj, int chan)
  248.  
  249.  
  250.           Returns a pointer to the entry for value zero of the table for
  251.           channel number _c_h_a_n.
  252.  
  253.      ggggeeeettttRRRRaaaannnnggggeeee(((())))
  254.  
  255.           void iflLutGetRange(iflLut *obj, double* min, double* max)
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. iiiiffffllllLLLLuuuutttt((((3333))))         IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll          iiiiffffllllLLLLuuuutttt((((3333))))
  269.  
  270.  
  271.  
  272.           Returns the range of values that the look-up table contains in _m_i_n
  273.           and _m_a_x.
  274.  
  275.      ggggeeeettttVVVVaaaallll(((())))
  276.  
  277.           double iflLutGetVal(iflLut *obj, double domainIdx, int chan)
  278.  
  279.  
  280.           Returns the look-up table entry for channel, _c_h_a_n, and input value,
  281.           _d_o_m_a_i_n_i_d_x.  The domain index is scaled as needed to map onto the
  282.           actual table entries when the table length does not map one to one
  283.           onto the domain.
  284.  
  285.      int iflLutIsDiff(iflLut *obj, const iflLut* from)
  286.  
  287.  
  288.  
  289.      The method returns TRUE if the the this lut is not identical, in
  290.      attributes and tables contents, to the lut specified by _f_r_o_m; FALSE is
  291.      returned if the luts are the same.
  292.  
  293.      void iflLutSetData(iflLut *obj, void* dataPnt)
  294.  
  295.  
  296.  
  297.      This function replaces the array of all the tables in the lut with the
  298.      data pointed to be _d_a_t_a.  The array of data is not copied, nor is it
  299.      deallocated when the iflLut is deleted.  The format of the data must
  300.      match the data type, length, and number of channels in the iflLut.  See
  301.      the Class Description section for details on the layout of the look-up
  302.      table data.
  303.  
  304.      sssseeeettttDDDDoooommmmaaaaiiiinnnn(((())))
  305.  
  306.           iflStatus iflLutSetDomain(iflLut *obj, double min, double max)
  307.  
  308.  
  309.           Sets the range of values that this lut expects to _m_i_n and _m_a_x.  If
  310.           _m_a_x-_m_i_n+1 exceeds the current length of the table, a status of
  311.           iflBADPARAMS is returned; iflOKAY is returned if the operation is
  312.           successful.
  313.  
  314.      sssseeeettttVVVVaaaallll(((())))
  315.  
  316.           iflStatus iflLutSetVal(iflLut *obj, double val, double domainIdx,
  317.                                  int chan)
  318.  
  319.  
  320.           This function sets the look-up table entry for channel, _c_h_a_n, and
  321.           input value, _d_o_m_a_i_n_i_d_x.  The value given by _v_a_l is converted to the
  322.           internal data type of the table.  If the entry indicated is not
  323.           contained in the iflLut, a value of iflBADPARAMS is returned;
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. iiiiffffllllLLLLuuuutttt((((3333))))         IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll          iiiiffffllllLLLLuuuutttt((((3333))))
  335.  
  336.  
  337.  
  338.           iflOKAY is returned if the operation is successful.  The domain
  339.           index is scaled as needed to map onto the actual table entries when
  340.           the table length does not map one to one onto the domain.
  341.  
  342. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  343.      iflColormap, iflSGIColormap
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.